export const schema = {
    type: "page",
    title: "编辑平台",
    initApi: "get:/api/platform/${id}",
    toolbar: {
        type: "button",
        actionType: "submit",
        label: "保存",
        icon: "fa fa-save pull-left",
        level: "primary",
        target: "platformForm"
    },
    body: [
        {
            type: 'wrapper',
            className: 'no-padder no-bg clear',
            body: [
                {
                    type: "nav",
                    stacked: false,
                    links: [
                        {
                            label: "编辑",
                            to: "/platform/edit/${id}"
                        },
                        {
                            label: "查看",
                            to: "/platform/view/${id}"
                        },
                        {
                            label: "设置",
                            to: "/platform/setting/${id}"
                        },
                    ]
                }
            ]
        },
        {
            type: "wrapper",
            className: "b-l b-b b-r bg-white no-padder",
            body: {
                api: "put:/api/platform/${id}",
                panelClassName: 'no-border m-b-none',
                redirect: "/platform/view/${id}",
                submitText: "",
                name: "platformForm",
                type: "form",
                title: "",
                mode: "horizontal",
                actions: [
                    {
                        type: "submit",
                        primary: true,
                        label: "保存",
                        icon: "fa fa-save pull-left"
                    }
                ],
                controls: [
                    {
                        type: "text",
                        name: "name",
                        label: "平台名称",
                        required: true
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "image",
                        name: "logo",
                        label: "Logo",
                        // accept: "image/png,image/jpeg",
                        maxSize: 10 * 1024 * 1024,
                        desc: '请选择 jpg 或者 png 图片，单个文件请不要超过 10M'
                    },

                    {
                        type: "divider"
                    },

                    [
                        {
                            type: "text",
                            name: "contact_name",
                            label: "联系人",
                            required: true
                        },

                        {
                            type: "text",
                            name: "contact_phone",
                            label: "联系电话",
                            validations: 'isPhone',
                            required: true
                        }
                    ],

                    {
                        type: "divider"
                    },

                    {
                        type: "text",
                        name: "contact_email",
                        label: "联系邮箱",
                        validations: 'isEmail',
                        required: true
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "region",
                        name: "address",
                        label: "联系地址",
                        required: true
                    },

                    {
                        type: "divider"
                    },

                    [
                        {
                            type: "text",
                            name: "corporate_name",
                            label: "机构法人姓名",
                            required: true
                        },

                        {
                            type: "text",
                            name: "corporate_id",
                            label: "法人身份证号",
                            validations: 'isID',
                            required: true
                        }
                    ],

                    {
                        type: "divider"
                    },

                    {
                        type: "text",
                        name: "corporate_phone",
                        label: "法人联系电话",
                        validations: 'isPhone',
                        required: true
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "image",
                        name: "quality",
                        label: "上传资质",
                        multiple: true,
                        // accept: "image/png,image/jpeg",
                        maxSize: 10 * 1024 * 1024,
                        desc: '上传资质文件做个说明，请选择 jpg 或者 png 图片，单个文件请不要超过 10M，最多可上传5张。',
                        maxLength: 5
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "text",
                        name: "username",
                        label: "帐号",
                        validations: 'isAlphanumeric,minLength:6',
                        required: true
                    },

                    {
                        type: "divider"
                    },

                    {
                        type: "password",
                        name: "pwd",
                        label: "密码",
                        validations: 'minLength:6',
                    },

                    // {
                    //     type: "divider"
                    // },
                    //
                    // {
                    //     type: "text",
                    //     name: "email",
                    //     label: "邮箱",
                    //     validations: 'isEmail',
                    // }
                ]
            }
        }
    ]
};
